// triangle_test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include "triangle_test.h"

using std::cout;
using std::endl;

using boost::format;

int _tmain(int argc, _TCHAR* argv[])
{
	point_vector points;
	point center(0.0f, 0.0f);
	generate_circle(center, 5.0f, points);

	for(point_vector::iterator itr = points.begin();
		itr != points.end(); itr++){

		cout << format("%1%, %2%") % itr->x % itr->y << endl;
	}

	std::string line;
	std::getline(std::cin, line);
	return 0;
}

point::point(real x, real y) : x(x), y(y) {
}

void generate_circle(const point& center, real radius, point_vector& points){
	const int NPOINTS = 10;
	const double THETA = 2 * M_PI / NPOINTS;

	for(int i = 0; i < NPOINTS; i++){
		double thetai = THETA * i;
		double c = cos(thetai);
		double s = sin(thetai);

		points.push_back(point(center.x - c * radius, center.y + s * radius));
	}
}